lib/repo: Split archive/bare file parsing
authorColin Walters <walters@verbum.org>
Thu, 22 Jun 2017 17:03:14 +0000 (13:03 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 23 Jun 2017 14:11:36 +0000 (14:11 +0000)
commit63ad289a9c5ec76c071469fe8db7bb61d3b114c9
treec8e86ca63144612cc5d48763d8072cfcd46ab128
parentaafda9073ad581f9b8051d58947bbab9379badcc
lib/repo: Split archive/bare file parsing

Prep for future cleanup patches (in particular I want an internal-only
version at first that uses a fd+`struct stat`) to avoid allocations.

The new version avoids lots of deep nesting of conditionals as well
by hoisting the "not found" handling to an early return.

There's a bit of code duplication between the two cases but it's
quite worth the result.

Closes: #951
Approved by: jlebon
src/libostree/ostree-repo.c